
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>竞赛系统</title>
    <link rel="stylesheet" type="text/css" href="/static/css/login.css">
</head>
<body>
<div id="wrapper" class="login-page">
    <div id="login_form" class="form">
<!--        action="/user/login" method="post"-->
        <div class="login-form" >
            <h2>竞赛系统</h2>
            <input type="text" placeholder="用户名" name="account"  id="user_name" />
            <input type="password" placeholder="密码" name="password" id="password" />
            <button id="login" onclick="check_login();">登　录</button>
        </div>
    </div>
</div>

<script src="/static/js/jquery.min.js"></script>
<script type="text/javascript">
    function check_login()
    {
        var name=$("#user_name").val();
        var pass=$("#password").val();
        $.ajax({
            type:"post",
            url:"../user/login",
            data:"account="+name+"&password="+pass,
            success:function (res){
                if (res.status!=1){
                    $(location).attr('href', 'index.jsp');
                }else {
                    $("#login_form").removeClass('shake_effect');
                    setTimeout(function()
                    {
                        $("#login_form").addClass('shake_effect')
                    },1);
                }
            }
        })
    }

</script>
</body>
</html>